﻿using System.Collections.Generic;
using System.Web.Mvc;
using Matrix.MaKaYunShang.BLL;
using Matrix.MaKaYunShang.Model;

namespace Matrix.MaKaYunShang.McMagWeb.Controllers
{
    [Authorization]
    public class ConsumerController : BaseController
    {
        #region 列表
        [PermissionFilter]
        public ActionResult List()
        {
            return View();
        }

        [HttpPost]
        public JsonResult Listing(int draw, int start, int length)
        {
            var search = Request["search[value]"];
            var pageIndex = (start/length) + 1;
            var theList = ConsumerBLL.Instance.GetPagingList(new List<MagModules>(),draw, pageIndex, length, SqlSafe(search), CurrentUser.ShopId.ToString());
            var jsonResult = Json(theList);
            jsonResult.MaxJsonLength = int.MaxValue;
            return jsonResult;
        }
        #endregion
    }
}